#!/usr/bin/env python

# encoding: utf-8

'''
 * Create File random_string
 * Created by leixu on 2017/10/23
 * IDE PyCharm
'''
import random

"""随机生成字符串"""


def random_string(type=0, length=22):  # 默认为22位长度
    l = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    return ''.join([l[random.randrange(62)] for _ in range(length)])
